package ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.example.mynewsapp.R
import com.example.mynewsapp.databinding.FragmentSignupBinding

class SignUpFragment : Fragment() {
    private lateinit var binding: FragmentSignupBinding

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {
        binding = FragmentSignupBinding.inflate(inflater, container, false)
        return binding.root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

//        // 注册按钮点击事件
//        binding.btnSignUp.setOnClickListener {
//            val email = binding.editEmailSignUp.text.toString()
//            val password = binding.editPasswordSignUp.text.toString()
//            val confirmPassword = binding.editConfirmPassword.text.toString()
//
//            if (password == confirmPassword) {
//                // 模拟注册成功，跳转到登录页面
//                findNavController().navigate(R.id.action_signUpFragment_to_loginFragment)
//            } else {
//                // 显示密码不一致的错误提示
//            }
//        }
//
//        // 已有账户链接点击事件
//        binding.txtLogin.setOnClickListener {
//            // 跳转到登录页面
//            findNavController().navigate(R.id.action_signUpFragment_to_loginFragment)
//        }
    }
}